import request from '@/utils/request'

export function loginByUsername(username, password) {
  var params = new URLSearchParams()
  params.append('username', username)
  params.append('password', password)
  return request({
    url: 'auth',
    method: 'post',
    params
  })
}

export function logout() {
  return request({
    url: 'v1/login/logout',
    method: 'post'
  })
}

export function getUserInfo() {
  return request({
    url: 'v1/token/users',
    method: 'get'
  })
}

